/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package sge;

import java.util.logging.Level;
import java.util.logging.Logger;
import javax.swing.JDialog;
import javax.swing.JFrame;
import javax.swing.UIManager;
import javax.swing.UnsupportedLookAndFeelException;
import sge.Datos.FabricaConexion;
import sge.UI.FRMPrincipal;

/**
 *
 * @author victor
 */
public class SGE {
    
private static Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
    /**
     * @param args the command line arguments
     */
    public static void main(String[] args) {

        definirRegistroLogs();
        establecerConexionBaseDatos();
//        establecerLookAndFeel();
        cargarUI();

    }

    private static void definirRegistroLogs() {
        logger.setLevel(Level.ALL);
    }

    private static void establecerConexionBaseDatos() {
        while (!FabricaConexion.getInstancia().activa()) {
        }
    }

    private static void cargarUI() {
        java.awt.EventQueue.invokeLater(new Runnable() {
            @Override
            public void run() {
                FRMPrincipal frame = new FRMPrincipal();
                frame.setVisible(true);
                JFrame.setDefaultLookAndFeelDecorated(true);
                JDialog.setDefaultLookAndFeelDecorated(true);
                try {
                    UIManager.setLookAndFeel("javax.swing.plaf.metal.MetalLookAndFeel");
                    //UIManager.setLookAndFeel("com.sun.java.swing.plaf.nimbus.NimbusLookAndFeel");
        } catch (Exception e){}
            }
        });
    }
}